unit basicio_resources;

{$mode objfpc}{$H+}

{
  records to store resources, cost of all buildings
}

interface

uses
  Classes, SysUtils;

type

  { TResources }
  TResources = record
    Wood: Integer;
    Dirt: Integer;
    Sheeps: Integer;
    Wheat: integer;
    Ore: Integer;
  end;

const
  ResCost_City: TResources = (Wood: 1; Dirt: 1; Sheeps: 1; Wheat: 1; Ore: 0);
  ResCost_City_extended: TResources = (Wood: 0; Dirt: 0; Sheeps: 0; Wheat: 2; Ore: 3);
  ResCost_Street: TResources = (Wood: 1; Dirt: 1; Sheeps: 0; Wheat: 0; Ore: 0);
  ResCost_Inventions: TResources = (Wood: 0; Dirt: 0; Sheeps: 1; Wheat: 1; Ore: 1);

function Resources (AWood: Integer; ADirt: Integer; ASheeps: Integer; AWheat: integer; AOre: Integer): TResources;
function SumResources (a,b: TResources): TResources;

implementation

function Resources(AWood: Integer; ADirt: Integer; ASheeps: Integer;
  AWheat: integer; AOre: Integer): TResources;
begin
  result.Wood  := AWood;
  result.Dirt  := ADirt;
  result.Sheeps:= ASheeps;
  result.Wheat := AWheat;
  result.Ore   := AOre;
end;

function SumResources(a, b: TResources): TResources;
begin
  result.Wood  := a.Wood  + b.Wood;
  result.Dirt  := a.Dirt  + b.Dirt;
  result.Sheeps:= a.Sheeps+ b.Sheeps;
  result.Wheat := a.Wheat + b.Wheat;
  result.Ore   := a.Ore   + b.Ore;
end;

end.

